<template>
  <a-card>
    <a-form :model="copyTarget" layout="vertical">
      <a-form-item field="users" label="人员">
        <user-select v-model="copyTarget.users" />
      </a-form-item>
      <a-form-item field="roles" label="角色">
        <role-select v-model="copyTarget.roles" />
      </a-form-item>
      <a-form-item field="posts" label="职位">
        <post-select v-model="copyTarget.posts" />
      </a-form-item>
      <a-form-item field="depts" label="部门">
        <dept-select v-model="copyTarget.depts" />
      </a-form-item>
      <a-form-item field="deptLeaders" label="部门负责人">
        <dept-select v-model="copyTarget.deptLeaders" />
      </a-form-item>
    </a-form>
  </a-card>
</template>

<script lang="ts" setup>
import { ref, defineModel, defineProps, onMounted } from 'vue';
import { detailForm } from '@/api/system/form';
import UserSelect from '@/components/business-select/user-select.vue';
import RoleSelect from '@/components/business-select/role-select.vue';
import DeptSelect from '@/components/business-select/dept-select.vue';
import PostSelect from '@/components/business-select/post-select.vue';

const copyTarget = defineModel({ type: Object });

const props = defineProps({
  formId: {
    type: String,
    default: () => {
      return '';
    }
  }
});

const formItem = ref([]);

onMounted(() => {
  detailForm(props.formId).then(res => {
    formItem.value = res.data.formItem;
  });
});
</script>

<script lang="ts">
export default {
  name: 'ConfigCopyUser'
};
</script>

<style scoped lang="less">

</style>